package com.jinyi.wwdeng.network

import com.jinyi.wwdeng.AppConfigs

/**
 * JinYiTest
 * @Author wwdeng
 * @CreateTime: 2024/4/15 10:10
 * @Annotation：Api 接口
 */
object ApiService {

    /* 接口域名 */
    const val BASE_URL = "http://159.138.165.72"

    object API_URL {
        /**
         * 地区转发
         */
        const val API_TIMEZONE_URL = "/qxgvlemtzs6inixq1fqmna"
        /**
         * APP业务统一请求接口
         */
        const val API_COMMON_URL = "/bnE2fc87ar6M97nBg82Q"
        /**
         * 图片上传
         */
        const val API_UPLOAD_FILE_URL = "/a3Dyf2s5RaS9D5bhOU6GpA"
    }

    object API_PATH {
        /**
         * APP配置参数 Path
         */
        const val API_PATH_APP_INFO = "nm3ZSPlqNsJB6KvPTFB3IQ"
        /**
         * 发送验证码 Path
         */
        const val API_PATH_SMS = "T0SgXWQ1YqInXfyAONdLaQ"
        /**
         * 验证码登录
         */
        const val API_PATH_LOGIN = "VH7vqSZFdCIj0qGuSRAZw"
        /**
         * 用户流程状态
         */
        const val API_PATH_PROCESS = "ZjCNiOP4PAFsTygouIjlw"
        /**
         * 保存用户图片信息（身份证、护照、驾驶证、人脸）
         */
        const val API_PATH_OCR_INFO = "KSndcCZkORe31mWEfBXDA"
        /**
         * 用户贷款额度
         */
        const val API_PATH_CREDIT_LIMIT = "hWbO4O7HvvIoJYofVAArTQ"
        /**
         * 用户贷款额度预览信息
         */
        const val API_PATH_CREDIT_APPLY = "HJVwXms6r8uU0TyfpQI7cg"
        /**
         * 创建贷款申请订单
         */
        const val API_PATH_CREDIT_APPLY_ORDER_CREATE = "AbKiQ4HVtWe6NUvzxSN2w"
        /**
         * 贷款还款信息
         */
        const val API_PATH_CREDIT_REPAYMENT_INFO = "ap3RDQ3gP9ynIazatFw"
        /**
         * 贷款还款信息
         */
        const val API_PATH_CREDIT_REPAYMENT_URL = "PVF2YLw3Ytx090570d0oTA"
        /**
         * 推荐产品列表
         */
        const val API_PATH_RECOMMEND_APP = "twBzRj0jqBnwskzY8reCRQ"
        /**
         * 账户列表
         */
        const val API_PATH_ACCOUNT_LIST = "b1o8gY6mAYEKUA4lndVEVw"
        /**
         * 已绑定账户列表（法语）
         */
        const val API_PATH_ACCOUNT_LIST_FRENCH = "gwndGQdXqrxCE3KobX19Q"
        /**
         * 添加账户
         */
        const val API_PATH_ACCOUNT_ADD = "bYHdi4Ih92ILHE86uFaltQ"
        /**
         * 删除已绑定的账户
         */
        const val API_PATH_ACCOUNT_DELETE = "YcbYO5oCCeL7fwNdFNtTw"
        /**
         * 意见反馈
         */
        const val API_PATH_FEEDBACK_SUBMIT = "dNSvQHf2Y0eQIHJm8h52qg"
        /**
         * 评价弹框
         */
        const val API_PATH_SCORE_COMMENT = "ko9Nv0r3yid2LdWbvC7A"
        /**
         * 事件埋点
         */
        const val API_PATH_TRACK_EVENT = "qQXRF6bsEK2mVilioV4JQ"

    }

    /**
     * 获取请求Url
     */
    fun getHttpUrl(url: String): String{
        //地区转发
        val timeZone = AppConfigs.getSPString(AppConfigs.SP_KEY.SP_HENECREDIT_TIMEZONE)
        if (timeZone.isNotEmpty()){
            return "$BASE_URL/$timeZone$url"
        }
        return "$BASE_URL$url"
    }
}